﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BindWb.aspx.cs" Inherits="TCS.Web.MembersHome.BindWb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    
     <div >
        <%
            if (WeiBo.SinaAPI.SinaBase.User == null)
            {
                if (WeiBo.SinaAPI.SinaBase.oAuth == null)
                {
                    WeiBo.SinaAPI.oAuthSina oauth = new WeiBo.SinaAPI.oAuthSina();
                    oauth.AuthLink = oauth.AuthorizationSinaGet() + "&oauth_callback=http://localhost:4040/MembersHome/SinaApiCallBack.ashx?u="+Request.Params["u"];
                    WeiBo.SinaAPI.SinaBase.oAuth = oauth;
                }
        %>
        <a href="<%=WeiBo.SinaAPI.SinaBase.oAuth.AuthLink %>"><img src="/login_48.png" alt="登陆到新浪微博" /></a>
        <%}
            else
            {
                WeiBo.SinaAPI.SinaMUsers user = WeiBo.SinaAPI.SinaBase.User;
                string screen_name = user.screen_name;
                string profile_image_url = user.profile_image_url;

                /*
                WeiBo.SinaAPI.SinaApiWebService sina = new WeiBo.SinaAPI.SinaApiWebService();
                string file = Server.MapPath("/login_48.png");
                string status = "hello 中文";
                string xml = sina.statuses_upload(WeiBo.SinaAPI.SinaBase.oAuth, "xml", "status=" + status, file, DateTime.Now.ToString("yyMMddhhmmssfff") + ".png");
                //string xml = sina.statuses_update(WeiBo.SinaAPI.SinaBase.oAuth, "xml", "status=" + status);
                Response.Write(xml);
                */ 

        %>
        <img src="<%=profile_image_url %>" /> <%=screen_name%> 非常欢迎您光临~~
        <%--<a href="/SinaApiLogout.ashx">退出</a>--%>
        
         <asp:Button ID="Button1" runat="server" Text="确认绑定" onclick="Button1_Click" />
        
        <% 
            } %>
            
            
    </div>
    
    </form>
</body>
</html>
